
// ***********************************************************************
// AUTO GENERATED CLASS - Do Not Modify this file, if needed modify .tt
// ***********************************************************************
// Assembly         : InnovaApp_DomainLayer
// Author           : LJO+01
// Created          : 05/07/2013 23:07:47
// ***********************************************************************
// <copyright file="N.A." company="Copyright © Innovacall 2011">
//     Copyright (c) . All rights reserved.
// </copyright>
// <summary>
// Domain layer  
// DomainClass
// </summary>
// ***********************************************************************

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;


namespace InnovaApp.Layers.DomainLayer
{
    /// <summary>
    /// Class PressClipping
    /// </summary>
    [Serializable]
    public partial class PressClipping : _DomainLayer_Base
    {
        #region Primitive Properties
    	
        /// <summary>
        /// Gets or sets Id.
        /// </summary>
        /// <value>The Id.</value>
        public virtual int Id
        {
            get;
            set;
        }
    	
        /// <summary>
        /// Gets or sets FK_ManagedContent.
        /// </summary>
        /// <value>The FK_ManagedContent.</value>
        /// <remarks>
        /// Foregn key of PressClipping
        /// 
        /// </remarks>
        public virtual Nullable<int> FK_ManagedContent
        {
            get { return _fK_ManagedContent; }
            set
            {
                try
                {
                    _settingFK = true;
                    if (_fK_ManagedContent != value)
                    {
                        if (ManagedContent != null && ManagedContent.Id != value)
                        {
                            ManagedContent = null;
                        }
                        _fK_ManagedContent = value;
                    }
                }
                finally
                {
                    _settingFK = false;
                }
            }
        }
        private Nullable<int> _fK_ManagedContent;
    	
        /// <summary>
        /// Gets or sets ResumeImage.
        /// </summary>
        /// <value>The ResumeImage.</value>
        public virtual string ResumeImage
        {
            get;
            set;
        }
    	
        /// <summary>
        /// Gets or sets ResumeTitle.
        /// </summary>
        /// <value>The ResumeTitle.</value>
        public virtual string ResumeTitle
        {
            get;
            set;
        }
    	
        /// <summary>
        /// Gets or sets ArticleTitle.
        /// </summary>
        /// <value>The ArticleTitle.</value>
        public virtual string ArticleTitle
        {
            get;
            set;
        }
    	
        /// <summary>
        /// Gets or sets DirectURL.
        /// </summary>
        /// <value>The DirectURL.</value>
        public virtual string DirectURL
        {
            get;
            set;
        }
    	
        /// <summary>
        /// Gets or sets ArticleNameUrlFormatted.
        /// </summary>
        /// <value>The ArticleNameUrlFormatted.</value>
        public virtual string ArticleNameUrlFormatted
        {
            get;
            set;
        }
    	
        /// <summary>
        /// Gets or sets Description.
        /// </summary>
        /// <value>The Description.</value>
        public virtual string Description
        {
            get;
            set;
        }
    	
        /// <summary>
        /// Gets or sets Keywords.
        /// </summary>
        /// <value>The Keywords.</value>
        public virtual string Keywords
        {
            get;
            set;
        }
    	
        /// <summary>
        /// Gets or sets Robots.
        /// </summary>
        /// <value>The Robots.</value>
        public virtual string Robots
        {
            get;
            set;
        }
    	
        /// <summary>
        /// Gets or sets ReadyToPublish.
        /// </summary>
        /// <value>The ReadyToPublish.</value>
        public virtual Nullable<bool> ReadyToPublish
        {
            get;
            set;
        }
    	
        /// <summary>
        /// Gets or sets IndexingCategory.
        /// </summary>
        /// <value>The IndexingCategory.</value>
        public virtual string IndexingCategory
        {
            get;
            set;
        }
    	
        /// <summary>
        /// Gets or sets IsActive.
        /// </summary>
        /// <value>The IsActive.</value>
        public virtual Nullable<bool> IsActive
        {
            get;
            set;
        }
    	
        /// <summary>
        /// Gets or sets PublicationDate.
        /// </summary>
        /// <value>The PublicationDate.</value>
        public virtual Nullable<System.DateTime> PublicationDate
        {
            get;
            set;
        }
    	
        /// <summary>
        /// Gets or sets ExpirationDate.
        /// </summary>
        /// <value>The ExpirationDate.</value>
        public virtual Nullable<System.DateTime> ExpirationDate
        {
            get;
            set;
        }
    	
        /// <summary>
        /// Gets or sets LastBuildDate.
        /// </summary>
        /// <value>The LastBuildDate.</value>
        public virtual Nullable<System.DateTime> LastBuildDate
        {
            get;
            set;
        }
    	
        /// <summary>
        /// Gets or sets DateVersion.
        /// </summary>
        /// <value>The DateVersion.</value>
        public virtual Nullable<System.DateTime> DateVersion
        {
            get;
            set;
        }
    	
        /// <summary>
        /// Gets or sets rowversion.
        /// </summary>
        /// <value>The rowversion.</value>
        public virtual byte[] rowversion
        {
            get;
            set;
        }

        #endregion
        #region Navigation Properties
        public virtual ManagedContent ManagedContent
        {
            get { return _managedContent; }
            set
            {
                if (!ReferenceEquals(_managedContent, value))
                {
                    var previousValue = _managedContent;
                    _managedContent = value;
                    FixupManagedContent(previousValue);
                }
            }
        }
        private ManagedContent _managedContent;

        #endregion
        #region Association Fixup
    
        private bool _settingFK = false;
    
        private void FixupManagedContent(ManagedContent previousValue)
        {
            if (previousValue != null && previousValue.PressClipping.Contains(this))
            {
                previousValue.PressClipping.Remove(this);
            }
    
            if (ManagedContent != null)
            {
                if (!ManagedContent.PressClipping.Contains(this))
                {
                    ManagedContent.PressClipping.Add(this);
                }
                if (FK_ManagedContent != ManagedContent.Id)
                {
                    FK_ManagedContent = ManagedContent.Id;
                }
            }
            else if (!_settingFK)
            {
                FK_ManagedContent = null;
            }
        }

        #endregion
    }
}
